home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 24 / Mac Magazin and MacEasy Magazine CD - Issue 24.iso / Online / Anarchie-160 / Example Scripts / Download Files next >
Text File  |  1995-04-09  |  766b  |  30 lines

  1. -- Set this to the path to your download file that lists the files to fetch
  2. set theinput to (path to desktop as string) & "download"
  3.  
  4. set quitanarchie to false
  5.  
  6. set thedata to read file theinput
  7.  
  8. copy thedata & return to thedata
  9. set newdata to ""
  10. set i to 1
  11. repeat while i ≤ (the number of paragraphs of thedata)
  12.     set theurl to paragraph i of thedata
  13.     if length of theurl > 0 then
  14.         tell application "Anarchie"
  15.             set quitanarchie to true
  16.             with timeout of 3600 seconds
  17.                 set err to fetch url theurl expand with ".,.,"
  18.                 set keepit to (err is not 0)
  19.             end timeout
  20.         end tell
  21.         if keepit then
  22.             copy (newdata & (paragraph i of thedata) & return) to newdata
  23.         end if
  24.     end if
  25.     set i to i + 1
  26. end repeat
  27.  
  28. set eof file theinput to 0
  29. write newdata to file theinput
  30.